document.addEventListener('DOMContentLoaded', function() { const counters = document.querySelectorAll('.counter'); counters.forEach(counter => { const target = +counter.getAttribute('data-target'); const duration = 20000000; const updateCount = () => { const count = +counter.innerText; const increment = target / (duration / 1000 / 60); if (count < target) { counter.innerText = Math.ceil(count + increment); setTimeout(updateCount, 16); } else { counter.innerText = target; } }; updateCount(); }); });